<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<link rel="shortcut icon" href="../../static/images/favicon.ico"/>
	#include('../cdn/cdn.html')
	<title>满意度测评系统后台登陆</title>
	<style type="text/css">
		.login {
            margin: 22vh auto;
            width: 30%;
			min-width: 280px;
            text-align: center;
        }
	</style>
</head>
<body>
	<div style="position: fixed;
	z-index: -1;
	background: url('../../static/images/admin/login.jpg') no-repeat;
	background-size: cover;
	height: 100vh;
	width: 100vw;">
	</div>
	<div class="container">
		<div class="login">
			<div class="panel">
				<div class="panel-heading">
					<div class="panel-title">满意度测评系统后台登陆</div>
				</div>
				<div class="panel-body">
					<form method="post">
						<div class="form-group">
							<input type="text" class="form-control" name="username" placeholder="用户名" required="required">
						</div>
						<div class="form-group">
							<input type="password" class="form-control" name="password" placeholder="密码" required="required">
						</div>
						<div class="pull-right">
							<label for="bao">
								<input id="bao" type="checkbox" name="remember" value="true" checked="checked">记住密码&nbsp;
							</label>
						</div>
						<button type="submit" class="btn btn-info btn-group-justified">登 录</button>
						<!-- p class="text-muted text-center"> <a href="#"><small>忘记密码了？</small></a> | <a href="#"><small>注册一个新账号</small></a></p -->
					</form>
				</div>
			</div>
		</div>
	</div>
	<script type="text/javascript">
		$('form').submit(function(event) {
			event.preventDefault();
			var data = $('form').serialize();
			console.log(data);
			$.post("/admin/login", data, function(data) {
				if (data.success) {
                    alert('登录成功！');
                    #if(prev != "")
                        location.href = '${prev}';
					#else
						location.href = '/admin';
					#end
                } else {
				    alert('失败咯！')
                }
			});
		});
	</script>
</body>
</html>